home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 12
/
CU Amiga Magazine's Super CD-ROM 12 (1997)(EMAP Images)(GB)[!][issue 1997-07].iso
/
CUCD
/
Games
/
DestructivePoker
/
sources
/
sources.lha
/
handpile.h
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-13
|
2KB
|
88 lines
/*
handpile.h (Käsipakan määrittely)
V1.00 - 151096 Kimmo Teräväinen
----- ------ ----------------
V0.01 151096 Aloitettu
V0.05 161096 Arvio() tehty ja testattu
V0.10 201096 cIMGKorttia ei enää peritä cKortista
cIMGKortti voidaan kääntää (ylösalaisin)
cKasiPakka periytyy caKuviosta
V0.11 201096 cIMGKortti siirretty tiedostoon kortti.h
V0.12 231096 cKasiPakka periytyy caPakasta
V0.13 031196 cKasiPakka -> cHandPile
*/
#ifndef DC1_POKER_HANDPILE
#define DC1_POKER_HANDPILE
#include "cardpile.h"
// Evaluation defines
//
//
const int LOUSY_HAND = 0;
const int PAIR = 1;
const int TWO_PAIRS = 2;
const int THREE_OF_KIND = 3;
const int STRAIGHT = 4;
const int FLUSH = 5;
const int FULL_HOUSE = 6;
const int FOUR_OF_KIND = 7;
const int FIVE_OF_KIND = 8;
const int STRAIGHT_FLUSH= 9;
const int ROYAL_FLUSH = 10;
const int CARD_SLOT_WIDTH = CARD_WIDTH+10;
// Flags for cHandPile
//
const int FLAG_5_KIND = 0x0100; // 0=if 5 of kind < straight flush
const int FLAG_5_JOKERS = 0x0200; // 0=5 jokers is lousy hand
class cHandPile : public cCardPile {
int prefs;
public:
cHandPile(int x=100,int y=100,int pjoker=0, int p5kind=0) : cCardPile(5,x,y)
{
if(pjoker) prefs|=FLAG_5_JOKERS;
if(p5kind) prefs|=FLAG_5_KIND;
cards[0]=cards[1]=cards[2]=cards[3]=cards[4]=NULL;
}
void TurnAll();
void Turn(int card) { if(cards[card]) cards[card]->Turn(); }
void FreezeAll();
virtual cIMGCard *Deal();
virtual cIMGCard *Remove(int);
virtual void Insert(cIMGCard *);
virtual void Insert(cCardPile &) {};
virtual int Can_Insert() const;
virtual int Can_Insert(cIMGCard *) const { return Can_Insert(); }
int SetPrefs_5jokers(int r=FALSE) {
if(r) prefs|=FLAG_5_JOKERS;
else prefs&=(0xffff-FLAG_5_JOKERS);
return GetPrefs_5jokers();
}
int SetPrefs_5ofkind(int r=FALSE) {
if(r) prefs|=FLAG_5_KIND;
else prefs&=(0xffff-FLAG_5_KIND);
return GetPrefs_5ofkind();
}
int GetPrefs_5jokers() const { return prefs & FLAG_5_JOKERS; }
int GetPrefs_5ofkind() const { return prefs & FLAG_5_KIND; }
int Evaluate() const;
};
#endif